import Vue from 'vue'
import App from './App.vue'
import router from './router/router'
import './plugins/element.js'
import './assets/css/global.css'
// 导入表格树
import TreeTable from 'vue-table-with-tree-grid'

// 引用axions，设置默认url
import axios from 'axios'
axios.defaults.baseURL = 'http://timemeetyou.com:8889/api/private/v1/'
Vue.prototype.$http = axios
// axios拦截器，发送请求前携带token
axios.interceptors.request.use(config => {
  const token = window.sessionStorage.getItem('token')
  if (token) {
    // console.log(config)
    config.headers.Authorization = token
  }
  return config
})
// 组件全局注册 表格树
Vue.component('tree-table', TreeTable)

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
